"""project URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.urls import path

from . import views

urlpatterns = [
    # 项目相关
    path('', views.project_index_view, name='project_index'),
    path('list/', views.ProjectListView.as_view(), name='project_list'),
    path('<str:project_id>', views.ProjectView.as_view(), name='project_detail'),

    # 模型相关
    path('model/', views.ModelListView.as_view(), name="model_list"),
    path('model/<str:model_id>/', views.ModelView.as_view(), name="model_detail"),
    path('model/public/<str:model_id>/', views.generate_public_model_from_private_view, name="model_public"),
    path('model/private/<str:model_id>/', views.generate_private_model_from_public_view, name="model_private"),

    # 方案相关
    path('alternative/', views.AlternativeListView.as_view(), name="alternative_list"),
    path('alternative/<str:alter_id>/', views.AlternativeView.as_view(), name="alternative_detail"),

    # 实例相关
    # path('<str:project_id>/instance/', views.InstanceListView.as_view(), name='instance_list'),
    path('<str:project_id>/instance/-1/', views.InstanceView.as_view(), name='create_instance'),
    path('instance/<str:instance_id>/', views.instance_detail_view, name='instance_detail'),
    path('instance/<str:instance_id>/result/', views.get_instance_result_view, name='instance_result'),


    path('instance/<str:instance_id>/alternative/', views.edit_alternative, name='alternative_instance_list'),
    path('instance/<str:instance_id>/add_alternative/<str:alternative_id>/', views.add_alternative, name='add_alternative_instance'),
    path('instance/<str:instance_id>/delete_alternative/<str:alternative_id>/', views.delete_alternative, name='delete_alternative_instance'),

    path('result/', views.result_list_view, name='result_list'),
    path('result/<str:result_id>/', views.result_detail_view, name='result_detail'),

]
